package com.duqc.tag.controller;

import com.duqc.response.ResultMsg;
import com.duqc.tag.entity.Tag;
import com.duqc.tag.service.TagService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName TagController
 * @Description TagController
 * @Author duqc
 * @Date 2023/2/8
 **/
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("tag")
public class TagController {

    private final TagService tagService;

    /**
     * 保存标签信息
     *
     * @param tag 标签信息
     * @return ResultMsg
     */
    @PostMapping(value = "/add")
    public ResultMsg add(@RequestBody Tag tag) {
        return ResultMsg.success(this.tagService.add(tag));
    }

}
